package com.inspur.edp.common.expr.expresses.not;


import com.inspur.edp.common.expr.Express;
import com.inspur.edp.common.expr.ExpressDSLGenerator;
import com.inspur.edp.common.expr.ExpressDSLGeneratorMgr;
import com.inspur.edp.common.expr.ast.ASTContext;

/**
 * @author lizhaorui
 * @description TODO
 * @date 2025/4/17 10:32
 */
public class NotExpressDSL implements ExpressDSLGenerator {

    @Override
    public String getKind() {
        return NotExpress.KIND;
    }

    @Override
    public String generate(ASTContext context, Express express) {
        NotExpress notExpress = (NotExpress) express;
        String expressDsl = ExpressDSLGeneratorMgr.generateDsl(context, notExpress.getExpress());
        return String.format("!(%s)", expressDsl);
    }
}
